# -*- coding: utf-8 -*-
import requests, json, sys
import robot
from robot.libraries.BuiltIn import BuiltIn
from robot.api import logger

class TestKeywords(object):
    ROBOT_LIBRARY_SCOPE = 'Global'
    def __init__(self):
        self.request = None
    def mytest(self):
        print "mytest"
    def get_link_service(self,service_type):
        r = requests.get('http://eve-beta.pf.tap4fun.com:10000/config?client_id=pf:1.0.0')
#        logger.info(r.json(), False, True)
        s =r.json()['cfn']['servers']['name']+'/locate?service='+service_type+'&client_id=G301:1.0'
#        logger.info(s, False, True)
        r = requests.get(s)
        return r.json()['host']+':'+str(r.json()['https_port'])
if __name__ == '__main__':
    pass